package com.codejoys.monitor.web;

import com.codejoys.monitor.domain.SysConfig;
import com.codejoys.monitor.dto.BaseResult;
import com.codejoys.monitor.service.SysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SysConfigController {

    @Autowired
    SysConfigService sysConfigService;


    @PreAuthorize("hasRole('admin')")
    @PostMapping("/sysConfig")
    public BaseResult add(SysConfig sysConfig){
        sysConfigService.add(sysConfig);

        return BaseResult.success();
    }
}
